package com.pt.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum PromotionStatus {
    NORMAL(0, "普通"),
    FREE(1, "免费"),
    DOUBLE_UPLOAD(2, "2X上传"),
    HALF_DOWNLOAD(3, "50%下载"),
    DOUBLE_UPLOAD_HALF_DOWNLOAD(4, "2X上传50%下载");

    private final int code;
    private final String desc;

    public static PromotionStatus getByCode(Integer code) {
        if (code == null) {
            return NORMAL;
        }
        
        for (PromotionStatus status : PromotionStatus.values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        return NORMAL;
    }
} 